#-----------------------------------------------------------------------------
# Name:         Class_ABC_Crypt.py
# Purpose:      Classe de cryptage des logs
#               
#
# Author:      ABCPro
#
# Created:     2007/04/18
# Copyright:   (c) 2007
# Licence:     <your licence>
#-----------------------------------------------------------------------------

import os,sys,time,datetime,base64

class ABC_Crypt :
    
 
        

  def Crypt (self,text):
      t = time.localtime(time.time())
      Hour = time.strftime("%d-%B-%Y   %H:%M:%S", t)  #Date et heure
      texte = ""
      texte = base64.encodestring(str(Hour))+ base64.encodestring(text)
      return str(texte)
  
  
  def DeCrypt (self,text):
  
      texte = ""
      texte = base64.decodestring(text)
      return str(texte)


  def LogMes (self,Fiche,Mes):
      
        File = open(Fiche,"a")
        Mes = self.Crypt(Mes)
        File.write(Mes)
        File.close()
 
